# Makefile.in
# $Id: Makefile.in,v 1.9 2000-01-22 05:05:24 arensb Exp $

PACKAGE =	@PACKAGE@
VERSION =	@VERSION@

subdir =	doc
srcdir =	@srcdir@
top_srcdir =	@top_srcdir@
curdir =	${top_srcdir}/${subdir}
prefix =	@prefix@
MANDIR =	@mandir@
MAN8DIR =	${MANDIR}/man8
INFODIR =	@infodir@

INSTALL =	@INSTALL@
INSTALLARGS =	-m 555

MAKEINFO =	@MAKEINFO@
TEXI2DVI =	@TEXI2DVI@
DVIPS =		@DVIPS@
TEXI2HTML =	@TEXI2HTML@

DISTDIR =	${top_srcdir}/${PACKAGE}-${VERSION}

INFOFILES =	libpalm.info \
		pdb.info \
		conduits.info
DVIFILES =	libpalm.dvi \
		pdb.dvi \
		conduits.dvi
PSFILES =	libpalm.ps \
		pdb.ps \
		conduits.ps

# XXX - Should we include HTML documentation in the distribution? If
# nothing else, it might be nice to set things up so that you can.
# HTMLFILES =	conduits.html
# ALLHTMLFILES =	${HTMLFILES} \
# 		conduits_1.html \
# 		conduits_2.html \
# 		conduits_3.html \
# 		conduits_4.html \
# 		conduits_5.html \
# 		conduits_foot.html \
# 		conduits_toc.html

DISTFILES =	Makefile.in \
		libpalm.texi \
		pdb.texi \
		conduits.texi \
		version.texi.in \
		texinfo.tex \
		coldsync.8
# Additional files to include in the official distribution, not included
# in snapshots
EXTRA_DISTFILES = \
		${INFOFILES} \
		${PSFILES}

CLEAN =		${INFOFILES} ${DVIFILES} ${PSFILES} \
		*.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.ty *.vr \
		*.bak *~ errs errs.* \
		*.html
DISTCLEAN =	Makefile version.texi .depend
SPOTLESS =

.SUFFIXES:	.dvi .info .ps .texi .html

.texi.info:
	${MAKEINFO} $<

.texi.dvi:
	${TEXI2DVI} $<

.dvi.ps:
	${DVIPS} -o $@ $<
# .texi.html:
# 	${TEXI2HTML} -split_chapter $<
# 	-rm -f $@
# 	ln -s `echo "$<" | sed 's/\.texi$$//'`_toc $@

all:	${INFOFILES}
all-doc:	info dvi ps
info:	${INFOFILES}
dvi:	${DVIFILES}
ps:	${PSFILES}

# XXX
html:	conduits_toc.html
conduits_toc.html:	conduits.texi
	${TEXI2HTML} -split_chapter conduits.texi

depend:

install::	coldsync.8
	if test ! -d ${MANDIR}; then \
		mkdir ${MANDIR}; \
		chmod 755 ${MANDIR}; \
	fi
	if test ! -d ${MAN8DIR}; then \
		mkdir ${MAN8DIR}; \
		chmod 755 ${MAN8DIR}; \
	fi
	${INSTALL} ${INSTALLARGS} coldsync.8 ${MAN8DIR}

distdir-core:	${DISTFILES}
	if test ! -d ${DISTDIR}/${subdir}; then \
		mkdir ${DISTDIR}/${subdir}; \
	fi
	cp -p ${DISTFILES} ${DISTDIR}/${subdir}

distdir::	distdir-core

distdir::	${EXTRA_DISTFILES}
	cp -p ${EXTRA_DISTFILES} ${DISTDIR}/${subdir}

clean:
	-rm -f ${CLEAN}
distclean:
	-rm -f ${CLEAN} ${DISTCLEAN}
spotless:
	-rm -f ${CLEAN} ${DISTCLEAN} ${SPOTLESS}

# Dependencies. Maintained manually 'cos I don't know of any tools
# that'll do it for me.
libpalm.dvi:	texinfo.tex version.texi
pdb.dvi:	texinfo.tex version.texi

# Dummy placeholder
lint:
